{template '../web_common/header'}

<!-- 中间内容 -->
<div class="mainContent clearfix">
    <div class="center-con clearfix">
        <h2 class="main-ttl">导入</h2>
        <div class="main-ctn clearfix">
            <div class="col-sm-12 execlList text-center">
                <button class="Btn {if $_GPC['step'] != 3}active{/if}" type="button">1.下载标准模板</button> &gt;
                <button class="Btn " type="button">2.上传</button> &gt;
                <button class="Btn {if $_GPC['step'] == 3}active{/if}" type="button">3.完成</button>
            </div>
            <div class="col-sm-12 execlCon text-center mt20">
                <div class="tab_content" style="display: block;">
                    <a class="Btn" href="{php echo $this->createWebUrl('knowledge', array('act' => 'downloadLabel', 'en_name' => 'label'))}">下载标准模板</a>
                    <p class="mt5">点击下载模板，请按照我们提供的标准模板填写 <span style="color: #ff0000;font-size: 16px;">（导入前请删除模版的参考数据）</span></p>
                    <table class="table table-condensed" style="margin-bottom: 50px">
                        <caption>导入规则说明</caption>
                        <tbody style="text-align: left;font-size: 15px">
                        <tr><td>1.标签名不能为空</td></tr>
                        <tr><td>2.标签名不能超过8个字</td></tr>
                        <tr><td>3.标签名不能重复</td></tr>
                        </tbody>
                    </table>
                </div>

                <div class="tab_content">
                    <form action="" method="post" enctype="multipart/form-data">
                        <div class="selectDic">
                            <button class="Btn" type="button">选择文件</button>
                            <input onchange="upload_file();" type="file" id="file" name="phpexcel">
                        </div>
                        <input name="token" type="hidden" value="{$_W['token']}">
                        <div class="mt5"><input class="Btn" name="submit" type="submit" value="上传"></div>
                    </form>
                </div>

                <div class="tab_content">
                    <h2>成功导入{$_GPC['s']}个信息</h2>
                    <p class="mt5">（<b>{$_GPC['f']}</b>个信息导入失败）<a href="{php echo $this->createWebUrl('label', array('act' => 'downFailFile'))}" class="c-primary">下载</a></p>
                </div>
            </div>
            <div class="col-sm-12 return pad0" style="position: absolute;bottom: 30px;left: 20px;">
                <button class="Btn" type="button" onclick="window.location.href='{php echo $this->createWebUrl('label', array('act' => 'index'));}'">返回</button>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    require(['jquery', 'layer', 'common'], function () {
        $(function(){
            //tab切换内容
            $('.execlList').find('button').eq(0).on('click',function(){
                $(this).addClass('active').siblings('button').removeClass('active');
                $('.tab_content').eq(0).show().siblings('.tab_content').hide();
            })
            $('.execlList').find('button').eq(1).on('click',function(){
                $(this).addClass('active').siblings('button').removeClass('active');
                $('.tab_content').eq(1).show().siblings('.tab_content').hide();
            })

            var step = "{$_GPC['step']}";
            if (step == 3) {
                $('.execlList').find('button').eq(2).show();
                $('.execlList').find('button').eq(2).addClass('active').siblings('button').removeClass('active');
                $('.tab_content').eq(2).show().siblings('.tab_content').hide();
            }
        })
    });
    function upload_file() {
        layer.msg('添加文件成功，请点击上传', {time: 1200});
    }
</script>
{template '../web_common/footer'}